//#include <stdio.h>
//#include <sys/types.h>
//#include <sys/stat.h>
//#include <fcntl.h>
//#include <unistd.h>
//#include <string.h>

//int main()
//{
//    int fd = open("log.txt", O_WRONLY|O_CREAT|O_TRUNC, 0666);
//    dup2(fd, 1);
//    printf("hello linux\n");
////    close(1);
////    open("log.txt", O_WRONLY|O_CREAT|O_TRUNC, 0666);
////    printf("hello linux\n");
//}
//#include <stdio.h>
//#include <unistd.h>
//#include <string.h>
//
//int main()
//{
//    FILE* fp = fopen("bite","w");
//    char str[]="linux so easy!";
//    fwrite(str,sizeof(str),1,fp);
//    fclose(fp);
//    return 0;
//}
//
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include<string.h>
int main()
{
    int fd = open("bite1", O_WRONLY|O_CREAT|O_TRUNC, 0666);
    const char* str="i like linux";
    write(fd,str,strlen(str)); 
    close(fd);
    return 0;
    
}
